package com.lap.eureka.configuration;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
import org.springframework.security.web.SecurityFilterChain;

/**
 * 解决客户端注册上来权限问题:
 *
 * <p>{@code registration failed Cannot execute request on any known server }
 *
 * @author Shuisheng Lao(劳水生)
 * @version 1.0.0
 */
@Configuration
@EnableWebSecurity
public class WebSecurityConfigurer {

  @Bean
  SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
    http.csrf(AbstractHttpConfigurer::disable);
    return http.build();
  }
}
